
public class ForecastDisplay implements MyObserver, DisplayElement {
	private MySubject mySubject;
	private float temperature;
	private float humidity;
	private float pressure;
	
	public ForecastDisplay(MySubject o) {
		this.mySubject = o;
		o.registerMyObserver(this);
	}
	
	public ForecastDisplay() {
		
	}
	
	@Override
	public void display() {
		System.out.println("Forecast: ... ...");
	}

	@Override
	public void update(Object o) {
		if(o instanceof WeatherData) {
			WeatherData weatherData = (WeatherData)o;
			this.temperature = weatherData.getTemperature();
			this.humidity = weatherData.getHumidity();
			this.pressure = weatherData.getPressure();
			display();
		}
	}
	
	public void registerObserver(MySubject o) {
		o.registerMyObserver(this);
	}
	public void deregisterObserver(MySubject o){
		o.removeMyObserver(this);
		
	}

}
